package com.hans.cloud.helloclient.openfeign;

import com.hans.cloud.api.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/feign/user")
public class UserClient {

    @Autowired
    private UserServiceAPClient userServiceAPI;

    /**
     * 根据用户id获取用户
     * @param id
     * @return
     */
    @GetMapping("/get")
    R get(@RequestParam(value = "id", required = false, defaultValue = "1") Long id ){
        return userServiceAPI.get(id);
    }
}
